home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / dev / c / amcsrc2.lha / AMCSources2 / NeuralN / TIMER.c < prev    next >
C/C++ Source or Header  |  1996-06-06  |  494b  |  30 lines

  1. /*
  2. *-----------------------------------------------------------------------------
  3. *    file:    timer.c
  4. *    desc:    time a program in secs
  5. *    by:    patrick ko
  6. *    date:    18 jan 92
  7. *-----------------------------------------------------------------------------
  8. */
  9.  
  10. #include <stdio.h>
  11. #include <time.h>
  12.  
  13. static time_t    last;
  14. static time_t    this;
  15. static time_t    temp;
  16.  
  17. void timer_restart( )
  18. {
  19.     time( &last );
  20. }
  21.  
  22. long int timer_stop( )
  23. {
  24.     time( &this );
  25.     temp = this - last;
  26.     last = this;
  27.  
  28.     return ((long int)temp);
  29. }
  30.